<template>
	<view>
		<block v-if="url">
			<web-view :src="url"></web-view>
		</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: ''
			};
		},
		onLoad(options) {
			this.url = decodeURIComponent(options.url)
		},
		onShareAppMessage(option) {
			let url = ''
			if(option.webViewUrl.indexOf('token')!=-1){
				url = option.webViewUrl.substring(0,option.webViewUrl.indexOf('?'))
			}else{
				url = option.webViewUrl
			}
			if(url.indexOf('tutorials')!=-1){
				return {
					title: '商学院',
					path: '/pages/webview/webview?url='+ encodeURIComponent(url)
				}
			}
		}
	}
</script>

<style lang="scss">

</style>
